package com.pj.wisdomlogistics.ui.view;

import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;

/**
 * Created by zhang on 2017/4/10.
 */

public class HLineSpaceItemDecoration extends RecyclerView.ItemDecoration {
    private int space;

    public HLineSpaceItemDecoration(int space) {
        this.space = space;
    }
    @Override
    public void getItemOffsets(Rect outRect, int itemPosition, RecyclerView parent) {

        int count = parent.getAdapter().getItemCount();

        outRect.bottom =itemPosition>=count-1 ? 0 : space;
    }
}
